Snipping Region
AutomatR.Windows.Activities.SnippingRegion
The "Snipping Region" activity in AutomatR for Windows Automation captures a specific region of the screen and saves it as an image file. This activity is particularly useful for extracting visual information from specific areas of the screen.
Properties
Name | Description |
---|---|
Input | |
Region Selection | The name or path of the image file representing the region to be captured. |
File Path | Represents the file path where the captured image will be saved. It is of type string. |
File Name | Represents the name of the file to be saved. It is of type string. |
Region | Represents a System.Drawing.Rectangle object that defines the region to capture. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before starting the "Snipping Region" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
Output | |
Get File Path | Outputs the full file path of the captured image. It is of type string. |
How to use:
- Drag and drop the "Snipping Region" activity onto the workflow.
- Configure the properties by providing the necessary inputs, such as the delay, region selection, file path, file name, and region.
- Optionally, configure the delay.
- Execute the workflow to capture the specified region of the screen and save it as an image file.
Example: Consider an example where the "Snipping Region" activity is used to capture a region of the screen and save it as an image:
Snipping Region:
Delay: 2
Region Selection: "C:\Path\To\Image.png"
File Path: "C:\Path\To\Save"
File Name: "CapturedImage"
Region: new System.Drawing.Rectangle(100, 100, 300, 200)
Get File Path: CapturedFilePath
In this example, the activity captures a region defined by the System.Drawing.Rectangle (100, 100, 300, 200) after a 2-second delay and saves the image as "CapturedImage.png" in the specified file path. The full file path of the captured image is stored in the variable "CapturedFilePath" for further use in the workflow.